"""drf URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,include
from aaa import old_views
from aaa.views import customer,demo
from aaa.views.role import rolesView
from aaa.views.user import userInfoView
from aaa.views.rights import rightsView
from aaa.views.goods import goodsInfoView
from aaa.views.categories import categoriesInfoView
from aaa.views.params import paramsView
from aaa.views.orders import orderInfoView
from aaa.views.hotsearch import hotsearchView
from aaa.views.storeservice import storeserviceView
from aaa.views.yy1170 import yysearchView
from aaa.views.report1170 import reportSearchView
from aaa.views.ad import adView
from aaa.views.mallmode import mallmodeView
from aaa.views.care import carefullyView
from aaa.views.goodsproduct import goodsproductmodeView
from aaa.views.ias import iasView
from aaa.views import task,bdwx
from django.conf.urls import url
from rest_framework import routers
router = routers.DefaultRouter()
router.register(r'users',userInfoView)
router.register(r'roles',rolesView)
router.register(r'rights',rightsView)
router.register(r'goods',goodsInfoView)
router.register(r'categories',categoriesInfoView)
# router.register(r'params',paramsInfoView)
router.register(r'orders',orderInfoView)
router.register(r'ad',adView)
router.register(r'mallmode',mallmodeView)
router.register(r'care',carefullyView)
router.register(r'hotsearch',hotsearchView)
router.register(r'storeservice',storeserviceView)
router.register(r'yy',yysearchView)
router.register(r'report',reportSearchView)
router.register(r'goodsproduct',goodsproductmodeView)
router.register(r'ias',iasView)

urlpatterns = [
    url(r'^(?P<version>[v1|v2]+)/auth/', old_views.authView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/order/', old_views.orderView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/roles/(?P<roleId>\d+)/rights/(?P<rightId>\d+)', old_views.removeRightView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/menus/', old_views.menuView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/role_display/', old_views.getRolesView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/cate_display/', old_views.getCategoriesView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/rights/tree/', old_views.rightsTreeView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/roles/(?P<roleId>\d+)/rights', old_views.allotRightsView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/users/(?P<userId>\d+)/role', old_views.allotRoleView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/order/', old_views.orderView.as_view()),
    # url(r'^(?P<version>[v1|v2]+)/users/(?P<pk>\d+)$', views.userInfoView.as_view(),name='users'),
    # url(r'^(?P<version>[v1|v2]+)/users/$', old_views.userInfoView.as_view({'get': 'list'})),
    # url(r'^(?P<version>[v1|v2]+)/roles/$', rolesView.as_view({'get': 'list','post':'create'})),
    # url(r'^(?P<version>[v1|v2]+)/roles/(?P<pk>\d+)/$', rolesView.as_view({'get': 'retrieve','delete':'destroy','put':'update','patch':'partial_update'})),
    url(r'^(?P<version>[v1|v2]+)/categories/(?P<cateId>\d+)/attributes/(?P<paramsId>\d+)/',paramsView.as_view({'get':'list'})),
    url(r'^(?P<version>[v1|v2]+)/categories/(?P<cateId>\d+)/attributes',paramsView.as_view({'get':'list'})),
    # url(r'^(?P<version>[v1|v2]+)/goods/edit',paramsView.as_view({'get':'list'})),
    url(r'^(?P<version>[v1|v2]+)/login/', old_views.loginView.as_view()),
    # url(r'v1/login/', old_views.login)
    url(r'^(?P<version>[v1|v2]+)/messages/', old_views.get_messages.as_view()),
    url(r'^(?P<version>[v1|v2]+)/infomation/export/', old_views.export_infomation_excel.as_view()),
    url(r'^(?P<version>[v1|v2]+)/dbs/', old_views.get_dbs.as_view()),
    url(r'^(?P<version>[v1|v2]+)/urls/', old_views.get_urls.as_view()),
    url(r'^(?P<version>[v1|v2]+)/upload/', old_views.upload),
    url(r'^(?P<version>[v1|v2]+)/devices/', old_views.get_devices),
    url(r'^(?P<version>[v1|v2]+)/query_devices/', old_views.query_devices),
    url(r'^(?P<version>[v1|v2]+)/all_goods_list/', old_views.all_goods_list),
    url(r'^(?P<version>[v1|v2]+)/goods_list/', customer.goods_list),
    url(r'^(?P<version>[v1|v2]+)/goods_detail/', customer.goods_detail),
    url(r'^(?P<version>[v1|v2]+)/my_page_data/', customer.my_page_data),
    url(r'^(?P<version>[v1|v2]+)/index_data/', customer.index_data),
    url(r'^(?P<version>[v1|v2]+)/collect_add/', customer.collect_add),
    url(r'^(?P<version>[v1|v2]+)/collect_list/', customer.collect_list),
    url(r'^(?P<version>[v1|v2]+)/category_list/', customer.category_list),
    url(r'^(?P<version>[v1|v2]+)/address_list/', customer.address_list),
    url(r'^(?P<version>[v1|v2]+)/address_create/', customer.address_create),
    url(r'^(?P<version>[v1|v2]+)/address_delete/', customer.address_delete),
    url(r'^(?P<version>[v1|v2]+)/ias_list/', customer.ias_list),
    url(r'^(?P<version>[v1|v2]+)/cart_add/', customer.cart_add),
    url(r'^(?P<version>[v1|v2]+)/cart_list/', customer.cart_list),
    url(r'^(?P<version>[v1|v2]+)/cart_delete/', customer.cart_delete),
    url(r'^(?P<version>[v1|v2]+)/submit_order/', customer.submit_order),
    url(r'^(?P<version>[v1|v2]+)/get_order_detail/', customer.get_order_detail),
    url(r'^(?P<version>[v1|v2]+)/save_order_detail/', customer.save_order_detail),
    url(r'^(?P<version>[v1|v2]+)/order_list/', customer.order_list),
    url(r'^(?P<version>[v1|v2]+)/bar/', demo.ChartView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/index/', demo.IndexView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/list_alerts/', old_views.listAlertsView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/list_alerts2/', old_views.listAlerts2View.as_view()),
    url(r'^(?P<version>[v1|v2]+)/list_offline/', old_views.listOfflineView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/get_alerts/', old_views.getAlertsView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/alerts/', old_views.AlertView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/alerts2/', old_views.Alert2View.as_view()),
    url(r'^(?P<version>[v1|v2]+)/alerts3/', old_views.Alert3View.as_view()),
    url(r'^(?P<version>[v1|v2]+)/alerts4/', old_views.Alert4View.as_view()),
    url(r'^(?P<version>[v1|v2]+)/rain/', old_views.RainView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/rate/', old_views.RateView.as_view()),
    url(r'^(?P<version>[v1|v2]+)/dx/', old_views.OfflineView.as_view(),name='掉线'),
    url(r'^(?P<version>[v1|v2]+)/', include(router.urls)),

    # celery示例
    # url(r'^task/$', task.create_task),
    # url(r'^get/result/$', task.get_result),
    url(r'^auction/add/$', task.auction_add, name='auction_add'),
]